<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import useNightModeStore from '../stores/nightModeStore';
const router = useRouter();
const nightModeStore = useNightModeStore();
const username = ref('');
const password = ref('');

const handleLogin = () => {
    // 在这里处理登录逻辑
    console.log('Username:', username.value);
    console.log('Password:', password.value);
};
// const isNight = ref(true);
// const changeMod = () => {
//     isNight.value = !isNight.value;//每次true变false变true
// }
//使用pinia里面的数据函数
</script>
<template>
    <!-- <div :style="{ width: '100%', height: '100vh', backgroundColor: isNight ? '#555' : 'white', color: isNight ? 'white' : 'black' }">
    </div>
    <div class="set">
        <i @click="changeMod" :class="isNight ? '' : 'light'">
            <span>{{ isNight ? "夜间模式" : "白天模式" }}</span>
        </i>
        <i class="userset" @click="router.back()">
            <span>设置</span>
        </i>
    </div> -->

    <div :class="['returnBar', nightModeStore.isNight ? 'night' : '']">
        <i class="back" @click="router.back()"></i>
    </div>
    <div class="head">
        <i class="header"> 登录知乎日报</i>
        <i class="title"> 选择登录方式</i>
        <img class="zhihu" src="../assets/zhihu.png"></img>
        <img src="../assets/weibo.png" class="weibo"></img>
        <label class="radio-label">
            <input type="checkbox" class="radio-input">
            <i class="radio"></i>
            我同意 <a href="https://www.zhihu.com/terms" class="span">《知乎协议》</a>和<a href="https://www.zhihu.com/term/zhihu-daily-info-security-guide?ssr_src=heifetz" class="span">《个人信息保护指引》</a>
        </label>
    </div>
    <div
        :style="{ width: '100%', height: '100vh', backgroundColor: nightModeStore.isNight ? '#555' : 'white', color: nightModeStore.isNight ? 'white' : 'black' }">
            <div class="set">
                    <i :class="nightModeStore.isNight ? '' : 'light'" @click="nightModeStore.changeMode()"><span>{{
                nightModeStore.isNight ? "夜间模式" : "白天模式" }}</span></i>
                    <i class="userset" @click="router.back()"><span>设置</span></i>
                </div>
    </div>





</template>
<style scoped>
.set {
    position: fixed;
    width: 100%;
    height: 50px;
    bottom: 0px;
    display: flex;
    justify-content: space-evenly;
}

.set i {
    font-style: normal;
    height: 50px;
    background: url(..//assets/yejianmoshi.png) no-repeat center top;
    background-size: 30px 30px;
    display: flex;
    align-items: flex-end;
}

.set i.light {
    background-image: url(..//assets/baitianmoshi.png)
}

.set i.userset {
    background-image: url(..//assets/shezhi.png)
}

.set i.back {
    background-image: url(..//assets/fanhui.png)
}

.returnBar {
    width: 100%;
    line-height: 50px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    position: relative;
}

.returnBar i {
    float: left;
    width: 50px;
    height: 50px;
    background: url(../assets/fanhui.png) no-repeat center center;
    background-size: 20px 20px;
}

.head .header {
    text-align: center;
    font-size: 25px;
    font-weight: bold;
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-style: normal;
}

.head .title {
    text-align: center;
    font-size: 15px;
    position: absolute;
    top: 24%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-style: normal;
    color: grey;
}

.zhihu {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 26%;
    left: 30%;
}

.weibo {
    position: absolute;
    width: 45.7px;
    height: 45.7px;
    top: 26%;
    left: 52%;
}




.radio-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 13.5px;
  transform: translateY(250px); 
}

.radio {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  border-radius: 50%;
  margin-right: 8px;
}

.radio::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background-color: blue;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s;
}

.radio-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  top: 50%;
  left: 50%;
}

.radio-input:checked + .radio::before {
  opacity: 1;
}
.span{
    color: blue;
}
</style>